Support facilities for the new DHCP support.
authoremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Tue, 29 Nov 2005 14:57:33 +0000 (14:57 +0000)
committeremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Tue, 29 Nov 2005 14:57:33 +0000 (14:57 +0000)
Signed-off-by: Ewan Mellor <ewan@xensource.com>
tools/examples/xen-network-common.sh

index c2fc311fac956e400b857c76ba89ad80a7cd6ab3..922d3a3dc89d169a44ac442f536f81d6aa3d3a90 100644 (file)
@@ -69,3 +69,29 @@ else
     true
   }
 fi
+
+
+first_file()
+{
+  t="$1"
+  shift
+  for file in $@
+  do
+    if [ "$t" "$file" ]
+    then
+      echo "$file"
+      return
+    fi
+  done
+}
+
+find_dhcpd_conf_file()
+{
+  first_file -f /etc/dhcp3/dhcpd.conf /etc/dhcpd.conf
+}
+
+
+find_dhcpd_init_file()
+{
+  first_file -x /etc/init.d/dhcp3-server /etc/init.d/dhcp
+}